package com.ruoyi.utils;

import org.apache.commons.lang3.time.DateFormatUtils;

import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * 日期工具类
 *
 * @author tanxingxian
 * @date 2021-12-20 17:39
 */
public class DateUtils {

    public static final String D = "yyyy-MM-dd";
    public static final String DT = "yyyy-MM-dd HH:mm:ss";
    public static final SimpleDateFormat DF = new SimpleDateFormat(D);
    public static final DateTimeFormatter DTF = DateTimeFormatter.ofPattern(DT);

    /**
     * 日期路径 即年/月/日 如2018/08/08
     */
    public static String datePath() {
        return DateFormatUtils.format(new Date(), "yyyy/MM/dd");
    }

}
